package com.shop.front.vo.store;

import com.alibaba.fastjson.annotation.JSONField;
import com.shop.jpa.domain.BaseDomain;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.*;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@ApiModel("商品分类")
@Data
@Entity
public class StoreCategoryVo extends BaseDomain implements Serializable {

    @ApiModelProperty(value = "id", hidden = true)
	@Id
    @Column(name = "id")
	@JSONField(serialize=false)
    private Long id;

    /**
	 * 父id
	 */
    @ApiModelProperty("父id")
	@Column(name = "pid")
    private Long pid;

    /**
	 * 名称
	 */
    @ApiModelProperty("名称")
	@Column(name = "cate_name")
    private String cateName;

    /**
     * 图标
     */
    @ApiModelProperty("图标")
    @Column(name = "pic")
    private String pic;

    /**
     * 排序序号
     */
    @ApiModelProperty("排序序号")
    @Column(name = "sort")
    private Integer sort;

    /**
	 * 创建时间
	 */
    @ApiModelProperty("创建时间")
	@Column(name = "create_time")
    private Date createTime;

    @Transient
    private List<StoreCategoryVo> childCategoryList = new ArrayList<>();

}